home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
windows
/
games
/
bjack1.exe
/
WKSTA.BAS
< prev
Wrap
BASIC Source File
|
1991-11-19
|
3KB
|
68 lines
Function LMNetWkstaGetInfo_L10% (Server$, VB_WkstaInfo As wksta_info_10)
' Wrapper: LMNetWkstaGetInfo_L10
' File: WKSTA.BAS
' Purpose: Returns information about the configuration
' elements for a workstation.
' Data Structure: wksta_info_10
' Level: 10
' Associated Files: WKSTA.TXT
' Parameters: Server - the name of the server on which to execute the
' command. A NULL string specifies the local computer.
' VB_WkstaInfo - wksta_info structure in which to store the
' returned data.
' Variables used in the NetWkstaGetInfo API call
Dim Level As Integer ' information level
Dim BufferPointer As Long ' pointer to LM buffer
Dim BufferSize As Integer ' buffer size
Dim TotalBytesAvail As Integer ' total bytes available
' Other variables
Dim result As Integer ' return value for API call
Level = 10 ' designates information level, cannot just change this
' value to change info level - structure name and constant
' name must also be changed (wksta_info_10 and
' FMT_wksta_info_10). The function name
' (LMNetWkstaGetInfo_L10) should also be changed.
' Create LM buffer and get size in BufferSize
BufferPointer = CreateLMBuffer(FMT_wksta_info_10, 1, BufferSize)
If BufferPointer = 0& Then ' error, unable to allocate buffer
LMNetWkstaGetInfo_L10 = -1
Exit Function
End If
' Call LM API function NetWkstaGetInfo to get data
result = NetWkstaGetInfo(Server, Level, BufferPointer, BufferSize, TotalBytesAvail)
' check for error return
If result <> NERR_Success Then ' error occurred
LMNetWkstaGetInfo_L10 = result ' set return for function
result = FreeLMBuffer(BufferPointer) ' free LM buffer
Exit Function
End If
' Copy data from LM buffer to wksta_info structure
result = BufferToVBType(VB_WkstaInfo, Len(VB_WkstaInfo), BufferPointer, BufferSize, FMT_wksta_info_10)
' check if error
If result = NERR_Success Then ' return OK
LMNetWkstaGetInfo_L10 = FreeLMBuffer(BufferPointer) ' free memory for LM buffer
Else ' error occurred, set return value
LMNetWkstaGetInfo_L10 = result
result = FreeLMBuffer(BufferPointer) ' free memory for LM buffer
End If
End Function